<?php
/**
 * Template: Comments.php 
 *
 * @package WP_Framework
 * @subpackage Default_Template
 */

// Do not delete these lines
	if ( !empty( $_SERVER[ 'SCRIPT_FILENAME' ] ) && 'comments.php' == basename( $_SERVER[ 'SCRIPT_FILENAME' ] ) )
		die ( 'Please do not load this page directly. Thanks!' );

	if ( post_password_required() ) { ?>
		<p class="no-comments">This post is password protected. Enter the password to view comments.</p>
	<?php
		return;
	}
?>

<?php if ( $comments ) : /* You can start editing here. */ ?>
<!--BEGIN #comments-->
<div id="comments">

	<h3 id="comments-number"><?php comments_number( 'No Responses', 'One Response', '% Responses' );?> to &#8220;<?php the_title(); ?>&#8221;</h3>
	
    <!--BEGIN .navigation-->
	<div class="navigation">
		<div class="comment-nav-previous"><?php previous_comments_link(); ?></div>
		<div class="comment-nav-next"><?php next_comments_link(); ?></div>
	<!--END .navigation-->
    </div>
	
    <!--BEGIN .comment-list-->
	<ol class="comment-list">
		<?php wp_list_comments(); ?>
    <!--END .comment-list-->
	</ol>
	
    <!--BEGIN .navigation-->
	<div class="navigation">
		<div class="comment-nav-previous"><?php previous_comments_link(); ?></div>
		<div class="comment-nav-next"><?php next_comments_link(); ?></div>
	<!--END .navigation-->
    </div>
<!--END #entry-comments-->
</div>
	<?php else : // this is displayed if there are no comments so far ?>

	<?php if ( 'open' == $post->comment_status ) : // If comments are open, but there are no comments. ?>
    	<?php else : // comments are closed ?>
		<!--BEGIN #entry-comments-->
        <div id="entry-comments">
            <p class="no-comments">Comments are closed.</p>
        <!--END #entry-comments-->
        </div>
	<?php endif; // if ( 'open' == $post->comment_status )  ?>
<?php endif; // if ( $comments ) ?>
    
<?php if ( 'open' == $post->comment_status ) : ?>
<!--BEGIN #respond-->
<div id="respond">
    <h3 id="leave-a-comment"><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></h3>
    
    <div class="cancel-comment-reply"><?php cancel_comment_reply_link(); ?></div>
    
    <?php if ( get_option( 'comment_registration' ) && !$user_ID ) : ?>
    <p>You must be <a href="<?php echo get_option( 'siteurl' ); ?>/wp-login.php?redirect_to=<?php echo urlencode( get_permalink() ); ?>">logged in</a> to post a comment.</p>
    <?php else : ?>
	
    <!--BEGIN #comment-form-->
	<form id="comment-form" method="post" action="<?php echo get_option( 'siteurl' ); ?>/wp-comments-post.php">
		<?php if ( $user_ID ) : ?>

        <p>Logged in as <a href="<?php echo get_option( 'siteurl' ); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="Log out of this account">Log out &raquo;</a></p>
		
		<?php else : ?>
		
        <p><input name="author" id="author" type="text" value="<?php echo $comment_author; ?>" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
        <label for="author" class="<?php if ( $req ) echo 'required'; ?>">Name</label></p>
        
        <p><input name="email" id="email" type="text" value="<?php echo $comment_author_email; ?>" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
        <label for="email" class="<?php if ( $req ) echo 'required'; ?>">Email</label></p>
        
        <p><input name="url" id="url" type="text" value="<?php echo $comment_author_url; ?>" tabindex="3" />
        <label for="url">Website</label></p>
        
		<?php endif; ?>

		<p class="allowed-tags"><abbr title="<?php echo allowed_tags(); ?>">Some HTML is OK</abbr></p>

        <p><textarea name="comment" id="comment" tabindex="4"></textarea></p>
        
        <p><button name="submit" id="submit" type="submit" tabindex="5">Submit Comment</button>
        <?php comment_id_fields(); ?></p>

	<?php do_action( 'comment_form', $post->ID ); ?>
    <!--END #comment-form-->
    </form>
    
	<?php endif; // If registration required and not logged in ?>

<!--END #respond-->
</div>
<?php endif; // (if ($comments)) - if you delete this the sky will fall on your head ?>